<template>
    <div>
    <div >
        <div class="section">
            <div class="swiper-container"
                 ref="slider">
                <div class="swiper-wrapper">
                    <div v-for="s in slides" class="swiper-slide">
                        <img :src="s.img_url"/>
                    </div>
                </div>


                <div class="swiper-pagination"
                     ref="pagination"></div>
            </div>
        </div>
        <div class="announcement">
            <label>快讯</label>
            <span>{{announcement}}</span>
        </div>
        <div class="book">

        </div>
        <div class="slides">

        </div>
    </div>

    <div class="section">
        <div class="bbok-list">
            <div class="header">
                <div class="heading">最新更新</div>
                <div class="more">更多...</div>
            </div>
            <div class="book-items">
                <div class="book" v-for="book in books">
                <div class="cover"><img :src="book.img_url"></div>
                <div class="title">{{book.title}}</div>
                    <div class="authors">{{book.authous}}</div>
                </div>

            </div>
        </div>

    </div>
        </div>
</template>


<script type="text/ecmascript-6">
    import Swiper from "swiper"
    import 'swiper/dist/css/swiper.css'

    export default{
        data(){
            return {
                announcement:"本周新书优惠，新上架电子书一律八折",
                slides:[
                    {img_url:require('./fixtures/sliders/t1.svg')},
                    {img_url:require('./fixtures/sliders/t2.svg')}]
                ,books:[{img_url:require("./fixtures/covers/1.svg"),title:'揭开数据真相'},
                    {img_url:require("./fixtures/covers/2.svg"),title:'Android高级进阶书'},
                    {img_url:require("./fixtures/covers/3.svg"),title:'淘宝天猫运行'}
                ]
            }
        },
        mounted() {
            debugger
            new Swiper(this.$refs.slider, {
                pagination: this.$refs.pagination,
                paginationClickable: true,
                spaceBetween: 30,
                centeredSlides: true,
                autoplay: 2500,
                autoplayDisableOnInteraction: false
            })
        }
    }
</script>